function Swiper(el)
{
    this.el = document.querySelector(el)
    this.t=null
    this.num=1
    this.kaishi()
}
Swiper.prototype.kaishi=function(){
    this.dingshiqi()
    this.yiru()
    // this.yichu()
}
Swiper.prototype.dingshiqi=function(){
    this.t=setInterval(()=>{
        this.num++
        if(this.num>6)this.num=1
        this.el.querySelector('img').src=`./imgs/img${this.num}.jpg`
        this.fenyeqi(this.num)
    },1000)
}
Swiper.prototype.fenyeqi=function(num){
    this.el.querySelector('ul li.active').className=''
    this.el.querySelectorAll('ul li')[num-1].className='active'
}
Swiper.prototype.yiru=function(){
    let yiruobj=this.el.querySelectorAll('ul li')
    yiruobj.forEach((item,i)=>{
        item.onmouseover=()=>{
            clearInterval(this.t)
            this.el.querySelector('img').src=`./imgs/img${i+1}.jpg`
            this.num=i+1
            this.fenyeqi(this.num)
        }
        item.onmouseout=()=>{
            this.yichu()
        }
    })
}
Swiper.prototype.yichu=function(){
    this.dingshiqi()
}
